<?php include '../public/header.php' ?>
<?php include '../public/header_index.php' ?>
<body class="laytp-container">
<div id="opt_nav">
</div>

<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" id="TableSearchFormId" lay-filter="TableSearchForm" onkeydown="keyTableSearch('TableSearchForm', 'datalist')">
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <label class="layui-form-label">工程负责人</label>
                        <div class="layui-input-block">
                            <input type="text" name="bid_gofuer" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item search-div">
                            <div class="layui-form-item layui-inline">
                                <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="TableSearchButton" type="button"><i class="layui-icon layui-icon-search"></i>查询</button>
                                <button class="layui-btn layui-btn-primary" onclick="listTableReset()" id="TableSearchReset" type="reset" ><i class="layui-icon layui-icon-refresh"></i>重置</button>
<!--                                <div id="search_open" onclick="toggle_search()">-->
<!--                                    <i class="layui-icon layui-icon-down"></i>展开-->
<!--                                </div>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_show('查看','{{d.LAY_TABLE_INDEX}}')">查看</a>
    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script>
    var param_gofuer = decodeURIComponent(getQueryVariable('gofuer') || '') || '';
    var param_bidid = getQueryVariable('bidid') || 0;
    var param_status = getQueryVariable('status') || '';
    $("#status").val(param_status)

    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;


        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });

        setSouTableExport('工程负责人前期费一览');
        var mytable = table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_qian_gofuer_lan_list),where: {bidid:param_bidid,status:param_status,gofuer:param_gofuer}, page: true, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,text: TabInit.text,totalRow: true
            ,parseData: function (res) {

                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.data.total,
                    "data": res.data.data.data
                };
            }
            , cols: [[
                {type: "checkbox", fixed: 'left'}
                ,{type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                ,{field: 'gofuer', title: '工程负责人'}
                ,{field:'nums',title:'工程报备数量(办事处)',totalRow: true,templet: function(d){
                        if(d.nums){
                            return '<span class="colorlan" onclick="openNavPage(\'工程报备-办事处\',\'bid_ban/index.php?status=1&gofuer='+encodeURIComponent(d.gofuer)+'\');">'+d.nums+'</span>';
                        }else{
                            return '';
                        }
                    }}
                ,{field:'qian_shou_fee',title:'前期费收入(元)',totalRow: true,templet: function(d){
                        if(d.qian_shou_fee){
                            return '<span class="colorlan" onclick="openNavPage(\'前期费收取\',\'qian_ban/index.php?status=1&gofuer='+encodeURIComponent(d.gofuer)+'\');">'+parseFormatNum(d.qian_shou_fee)+'</span>';
                        }else{
                            return '';
                        }
                    }}
                ,{field:'qian_zhi_fee',title:'前期费支出(元)',totalRow: true,templet: function(d){
                        if(d.qian_zhi_fee){
                            return '<span class="colorlan" onclick="openNavPage(\'前期费支付\',\'qian_zhi/index.php?status=1&gofuer='+encodeURIComponent(d.gofuer)+'&jinglei='+encodeURIComponent('办事处')+'\');">'+parseFormatNum(d.qian_zhi_fee)+'</span>';
                        }else{
                            return '';
                        }
                    }}
                ,{field:'tou_jiao_fee',title:'投标保证金缴纳(元)',totalRow: true,templet: function(d){
                        if(d.tou_jiao_fee){
                            return '<span class="colorlan" onclick="openNavPage(\'投标保证金缴纳\',\'tou_jiao/index.php?status=1&gofuer='+encodeURIComponent(d.gofuer)+'&jinglei='+encodeURIComponent('办事处')+'\');">'+parseFormatNum(d.tou_jiao_fee)+'</span>';
                        }else{
                            return '';
                        }
                    }}
                ,{field:'tou_fan_fee',title:'投标保证金返还(元)',totalRow: true,templet: function(d){
                        if(d.tou_fan_fee){
                            return '<span class="colorlan" onclick="openNavPage(\'投标保证金返还\',\'tou_fan/index.php?status=1&gofuer='+encodeURIComponent(d.gofuer)+'&jinglei='+encodeURIComponent('办事处')+'\');">'+parseFormatNum(d.tou_fan_fee)+'（'+parseFormatNum(d.tou_fan_11)+' + '+parseFormatNum(d.tou_fan_22)+'）</span>';
                        }else{
                            return '';
                        }
                    }}
                ,{field:'qian_yu_fee',title:'工程负责人前期费余额(元)',totalRow: true,templet: function(d){
                        return parseFormatNum(d.qian_yu_fee);
                    }}
            ]]
            , done: function (res) {
                soulTable.render(this);
            }
        });


        listTableSearch(form, table);
    });


</script>
</body>
</html>
